package dinner.web.secure;

import java.io.Serializable;

public class User implements Serializable {
	private static final long serialVersionUID = -7233763584953188164L;
	private String login;
	private String pass;
	protected Privilege privilege = Privilege.USER;

	public User(String login, String pass) {
		this.login = login;
		this.pass = pass;
	}

	public User() {
	}

	public String getLogin() {
		return login;
	}

	public boolean checkPass(String pass) {
		return this.pass.equals(pass);
	}

	public void checkPrivilegions(Privilege admin) throws UnAutorizationException {
		if (privilege.compareTo(admin) < 0)
			throw new UnAutorizationException("is not admin");

	}
}
